package com.sysu.homework.model;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

@Entity
public class Student {
	private int id;
	private String name;
	private String password;
	private Group group;
	private Course course;
	private List<HomeworkResult> homeworkResults = new ArrayList<HomeworkResult>();
	private Teacher teacher;
	private TeachAssistant ta;
	
	@Id
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	@ManyToOne
	public Group getGroup() {
		return group;
	}
	public void setGroup(Group group) {
		this.group = group;
	}
	@ManyToOne
	public Course getCourse() {
		return course;
	}
	public void setCourse(Course course) {
		this.course = course;
	}
	
	public void setTa(TeachAssistant ta) {
		this.ta = ta;
	}
	@ManyToOne
	public TeachAssistant getTa() {
		return ta;
	}
	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}
	@ManyToOne
	public Teacher getTeacher() {
		return teacher;
	}
	public void setHomeworkResults(List<HomeworkResult> homeworkResults) {
		this.homeworkResults = homeworkResults;
	}
	@OneToMany(mappedBy="student")
	public List<HomeworkResult> getHomeworkResults() {
		return homeworkResults;
	}
}
